﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using KPIS.GERP.GIMS.BLL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.MODEL;
using System.Data;
using System.IO;

namespace KPIS.GERP.GIMS.APP.APP_UI.UserControl
{
    public partial class TIP_Purchase_Request_Committee_History : System.Web.UI.UserControl
    {
        IBLLPrePurchaseRequestCommittee bllPprCom = new PrePurchaseRequestCommitteeBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                LoadGridCommittee();
            }
        }

        protected void LoadGridCommittee()
        {
            RadGrid TmpGrid = (RadGrid)RadPanelBar.FindItemByValue("BarH1").FindControl("Grid_Committee");
            int seq = Convert.ToInt32(Session["PrSeq"].ToString());
            TmpGrid.DataSource = bllPprCom.getPrePurchaseRequestCommitteeHistory(seq);

            GridGroupByExpression geFunction = new GridGroupByExpression(TmpGrid.Columns[1]);
            GridGroupByExpression geRefNo = new GridGroupByExpression(TmpGrid.Columns[2]);
            GridGroupByExpression geType = new GridGroupByExpression(TmpGrid.Columns[3]);
            TmpGrid.MasterTableView.GroupByExpressions.Add(geFunction);
            TmpGrid.MasterTableView.GroupByExpressions.Add(geRefNo);
            TmpGrid.MasterTableView.GroupByExpressions.Add(geType);
            TmpGrid.DataBind();
        }

        protected void Grid_Committee_ItemCommand(object source, GridCommandEventArgs e)
        {
            LoadGridCommittee();
        }
    }
}